<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/deng.css">

</head>

<body>
    <div class="top-action">
        <!-- 公告栏 -->
        <div class="top-notice">
            <div class="mall-mid clearfix">
                <div class="fl ico-comm i-laba"></div>
                <div class="fl notice-txt" id="blk_header_notice">
                    <ul style="margin-top: 0px;">

                        <li>pubg周边商城上线啦~，点击<a href="/mall/notice_detail.shtml?noticeid=1715"
                                target="_blank">查看详情&gt;</a></li>
                    </ul>
                </div>
                <script type="text/html" id="tmpl_header_notice">
                    {if data && data.length>0}
                    <ul>
                        {for item in data}
                        <li>${item.sTitle}，点击<a href="/mall/notice_detail.shtml?noticeid=${item.iSeqId}" target="_blank">查看详情></a></li>
                        {/for}
                    </ul>
                    {/if}
                </script>
            </div>
        </div>
        <!-- top-info S -->
        <div class="top-info">
            <div class="mall-mid clearfix">

                <div class="fl loginbar">
                    <!-- 登录前 S-->
                    <div class="unlogin" id="unlogin" style="display: block;">
                        <i class="ico-comm i-person"></i>
                        <a href="javascript:;" id="btn_header_login" title="立即登录">立即登录</a>
                    </div>
                    <!-- 登录前 E-->
                    <!-- 登录后 S-->
                    <div class="loginbox clearfix" id="logined" style="display: none;">
                        <div class="login-info">
                            <div class="fl hdimg">
                                <img src="" width="38" height="38" alt="头像">
                            </div>
                            <p class="fl hdname"><span id="userinfo"></span></p>
                        </div>
                        <div class="top-hover">
                            <div class="arrow"></div>
                            <div class="link-list">

                                <a href="/mall/myorder.shtml?busid=pubg" title="订单管理" target="_blank">
                                    <i class="fl ico-comm i-order"></i>
                                    <span>订单管理</span>
                                </a>
                                <a href="/mall/address.shtml" title="地址管理" target="_blank">
                                    <i class="fl ico-comm i-addr"></i>
                                    <span>地址管理</span>
                                </a>
                                <a href="/mall/coupon.shtml?busid=pubg" title="优惠卡券" target="_blank">
                                    <i class="fl ico-comm i-quan"></i>
                                    <span>优惠卡券</span>
                                </a>
                                <a href="/mall/collect.shtml?busid=pubg" title="我的收藏" target="_blank">
                                    <i class="fl ico-comm i-collect"></i>
                                    <span>我的收藏</span>
                                </a>
                                <a href="/mall/sub.shtml?busid=pubg" title="订阅管理" target="_blank">
                                    <i class="fl ico-comm i-subs"></i>
                                    <span>订阅管理</span>
                                </a>
                                <a href="/mall/receive.shtml?busid=pubg" title="领取中心" target="_blank">
                                    <i class="fl ico-comm i-lqcen"></i>
                                    <span>领取中心</span>
                                </a>
                                <a href="javascript:;" class="quit-link" title="退出登录" id="btn_header_logout">
                                    <i class="fl ico-comm i-quit"></i>
                                    <span>退出登录</span>
                                </a>

                            </div>
                        </div>
                    </div>
                    <!-- 登录后 E-->
                </div>
                <div class="logo-imgbox">
                    <a href="//pubg.qq.com/" target="_blank"><img
                            src="//js01.daoju.qq.com/zb/mall/images/custom/logo-pubg.png" width="108" height="55"
                            alt="pubg"></a>

                </div>
                <div class="fr sosobox clearfix" id="blk_header_search">
                    <input class="top-soso" placeholder="请输入想要找的宝贝" type="text" id="inpt_header_search">
                    <a href="javascript:;" class="btn-search" title="搜索" id="btn_header_search"><i
                            class="ico-pubg i-search"></i></a>
                </div>
            </div>
        </div>
        <!-- top-info E -->

        <!-- top-head S -->
        <div class="top-head">
            <div class="top-menu">
                <div class="mall-mid clearfix">
                    <a href="/lian/pubg/html/list.html" class="fl all-class" title="全部商品" target="_blank">
                        <i class="ico-pubg i-all"></i>
                        <span>全部商品</span>
                    </a>
                    <ul class="menulist clearfix" id="blk_header_navbar">
                        <li class="cur">
                            <!-- <a href="//pubg.qq.com/mall/index.shtml" class="ico-comm" title="首页"                            >首页</a> -->
                            <a href="/lian/pubg/index.html" title="首页" target="_blank">首页</a>
                        </li>
                        <li class="cur">
                            <!-- <a href="https://pubg.qq.com/mall/productlist.shtml" class="ico-comm" title="周年专区"                            >周年专区</a> -->
                            <a href="/lian/pubg/html/list.html" title="周年专区" target="_blank">周年专区</a>
                        </li>
                        <li class="cur">
                            <!-- <a href="https://pubg.qq.com/mall/productlist.shtml" class="ico-comm" title="精彩活动"                            >精彩活动</a> -->
                            <a href="/lian/pubg/html/list.html" title="精彩活动" target="_blank">精彩活动</a>
                        </li>
                        <li class="cur">
                            <!-- <a href="https://pubg.qq.com/mall/productlist.shtml" class="ico-comm" title="限时折扣"                            >限时折扣</a> -->
                            <a href="/lian/pubg/html/list.html" title="限时折扣" target="_blank">限时折扣</a>
                        </li>
                        <li class="cur">
                            <!-- <a href="https://pubg.qq.com/mall/productlist.shtml" class="ico-comm" title="聚豆抵扣2"                            >聚豆抵扣2</a> -->
                            <a href="/lian/pubg/html/list.html" title="聚豆抵扣2" target="_blank">聚豆抵扣2</a>
                        </li>
                    </ul>

                    <a href="/mall/cart.shtml" class="fr cartbox clearfix" id="blk_header_cart" target="_blank">

                    </a>

                </div>
            </div>
            <!-- 子菜单 -->
            <div class="top-submenu" style="display: none;">
                <div class="mall-mid clearfix">
                    <ul class="submenu-ul" id="blk_header_submenu">
                        <li class="submenu-li">
                            <a class="class-name" href="/mall/productlist.shtml?catid=638" target="_blank">
                                <img src="https://game.gtimg.cn/images/zb/x5/uploadImg/goods/201808/20180821105655_53879.png"
                                    alt="图标" width="30">
                                <p>周年纪念礼盒</p>
                            </a>
                            <ul class="class-list">
                                <li><a href="/mall/productlist.shtml?catid=817" target="_blank">礼盒分类</a></li>
                            </ul>
                        </li>
                        <li class="submenu-li">
                            <a class="class-name" href="/mall/productlist.shtml?catid=804" target="_blank">
                                <img src="" alt="图标" width="30">
                                <p>家居日用</p>
                            </a>
                            <ul class="class-list">
                                <li><a href="/mall/productlist.shtml?catid=807" target="_blank">T恤</a></li>
                                <li><a href="/mall/productlist.shtml?catid=808" target="_blank">卫衣</a></li>
                            </ul>
                        </li>
                    </ul>

                </div>
            </div>
        </div>
        <!-- top-head E -->

        <div class="den" style="display: none;"></div>
        <div class="ru" style="display: none;">

            <ul>
                <li class="f1">登录</li>
                <li class="f2">注册</li>
            </ul>
            <div>

                <div class="deng">
                    <p>帐号密码登录</p>
                    <input type="text" class="inps" placeholder="请输入帐号">
                    <input type="password" class="inps" placeholder="请输入密码">
                    <button>登录</button>
                </div>
                <div class="zuce" style="display: none;">
                    <p>帐号密码注册</p>
                    <input type="text" class="inps" placeholder="请输入注册帐号">
                    <input type="password" class="inps" placeholder="请输入注册密码">
                    <input type="text" class="inps" placeholder="电话">
                    <button>注册</button>
                </div>
            </div>
        </div>
    </div>

    <script>


        $(function () {
            $(document).on('click', '#unlogin', function () {
                $('.ru').css('display', "block")
                $('.den').css("display", 'block')
            })

            $('.f1').on('click', function () {
                $('.deng').css('display', "block")
                $('.zuce').css('display', "none")
            })
            $('.f2').on('click', function () {
                $('.zuce').css('display', "block")
                $('.deng').css('display', "none")
            })
            $('.den').on('click', function () {
                $('.den').css('display', "none")
                $('.ru').css('display', "none")
            })
            $('.deng').find('button').on('click', function () {
                var username = $('.deng').find('input').eq(0).val()
                var password = $('.deng').find('input').eq(1).val()
                if (!username && !password) {
                    return false
                }
                $.ajax({
                    type: "GET",
                    url: "http://localhost/lian/pubg/php/denru.php",
                    data: { username, password },
                    success: function (data) {
                        var dd = JSON.parse(data)
                        console.log(dd);
                        if (dd.code) {
                            setCookie('login_user', username, 1)
                            alert(dd.msg)
                            $('.den').css('display', "none")
                            $('.ru').css('display', "none")
                        }

                    }
                })


            })
            $('.zuce').find('button').on('click', function () {
                var username = $('.zuce').find('input').eq(0).val()
                var password = $('.zuce').find('input').eq(1).val()
                var phone = $('.zuce').find('input').eq(2).val()
                if (!username && !password) {
                    return false
                }
                $.ajax({
                    type: "GET",
                    url: "http://localhost/lian/pubg/php/zuce.php",
                    data: { username, password, phone },
                    success: function (data) {
                        var dd = JSON.parse(data)
                        console.log(dd);
                        alert(dd.msg)
                        if (dd.code) {
                            $('.deng').css('display', "block")
                            $('.zuce').css('display', "none")
                            $('#unlogin').css('display', 'none')
                            $('#logined').css('display', 'block')
                        }
                    }
                })
            })
            // aBtns.click(function(){
            //     aBtns.attr("class", "");
            //     aDivs.css("display", 'none');
            //     $(this).attr("class", "active");
            //     aDivs.eq($(this).index()).css("display", 'block');
            // })
            $('#btn_header_search').on('click',function(){
                var names = $('.top-soso').val()
                location.href = `./lists.html?username=${names}`
                
            })
        })
    </script>
</body>

</html>